<html>

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
  <link rel="stylesheet" title="Default" href="http://acm.math.spbu.ru/~sk1/colorer/my.css">

  <script src="http://acm.math.spbu.ru/~sk1/colorer/highlight.js"></script>
  <script src="http://acm.math.spbu.ru/~sk1/colorer/cpp.js"></script>
  <script>hljs.initHighlightingOnLoad();</script>
</head>

<body>

<pre><code>
/**
 * Author: Sergey Kopeliovich (Burunduk30@gmail.com5
 * Date: 2013.10.18
 */

#include &lt;cstdio&gt;
#include &lt;cstring&gt;
#include &lt;cassert&gt;
#include &lt;algorithm&gt;
#include &lt;map&gt;
#include &lt;string&gt;

using namespace std;

#define forn(i, n) for (int i = 0; i &lt; (int)(n); i++)
#define forit(i, a) for (__typeof((a).begin()) i = (a).begin(); i != (a).end(); i++)

const int N = (int)2e4;

map &lt;string, int&gt; m;
int n, cnt[N];
char s[21];

int main()
{
  while (scanf("%d%*d ", &n) == 1 && n)
  {
    m.clear();
    forn(i, n)
      gets(s), m[s]++;
    memset(cnt, 0, sizeof(cnt[0]) * n);
    forit(it, m)
      cnt[it-&gt;second - 1]++;
    forn(i, n)
      printf("%d\n", cnt[i]);
  }
  return 0;
}

</code></pre>

</body>
</html>

<font style="visibility:hidden">
